package com.gs.gaosheng.controller;

import com.gs.common.core.controller.BaseController;
import com.gs.common.core.domain.AjaxResult;
import com.gs.gaosheng.service.UserService;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户信息Controller
 *
 * @author yy
 * @date 2023-08-03
 */
@RestController
@RequestMapping("/gaosheng/user")
public class UserWebController extends BaseController {
    @Autowired
    private UserService userService;

    /**
     * 查询用户信息列表
     */
    @GetMapping("/feign/userScore")
    public Long userScore( String userAccount) {
        Long score = userService.selectUserScore(userAccount);
        return score;
    }

    @PostMapping("/feign/updateUserScore")
    public AjaxResult updateUserScore(@Param("userAccount")  String userAccount,
            @Param("userScore") Long userScore) {
        userService.updateUserScore(userAccount,userScore);
        return AjaxResult.success("修改成功");
    }

}
